package com.example.carrierapp.ui.currency;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.carrierapp.base.BaseActivity;
import com.example.carrierapp.config.ConstValue;
import com.example.carrierapp.event.CreateJFileDtoInfo;
import com.example.carrierapp.util.DisplayUtil;
import com.example.carrierapp.util.GlideApp;
import com.example.carrierapp.util.RoundCornerTransform;
import com.example.lb.fingerdemo.R;

import java.util.ArrayList;
import java.util.List;


public class SeePhotoActivity extends BaseActivity {
    private String filePath;

    private ImageView imageView;
    List<CreateJFileDtoInfo> finalFilePathList = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        filePath =  getIntent().getExtras().getString(ConstValue.FILE_PATH);
        finalFilePathList = (List<CreateJFileDtoInfo>)  getIntent().getExtras().getSerializable(ConstValue.FILE_PATH_LIST);
        imageView = findViewById(R.id.image);
        imageView.setOnClickListener(v -> finish());
        if (finalFilePathList == null || finalFilePathList.isEmpty() || finalFilePathList.size() == 1) {
            GlideApp.with(this).load(filePath).placeholder(R.mipmap.icon_default_img).into(imageView);
        } else {
            GlideApp.with(this).load(finalFilePathList.get(0).getDomain() + finalFilePathList.get(0).getPath() + finalFilePathList.get(0).getSuName()).placeholder(R.mipmap.icon_default_img).into(imageView);
        }
    }

    @Override
    public int getContentView() {
        return R.layout.activity_see_photo;
    }

    @Override
    public String getTitleString() {
        return "图片";
    }
}
